﻿using CommandSystem;
using RemoteAdmin;
using System;


namespace RoundTicks.Command
{
    [CommandHandler(typeof(GameConsoleCommandHandler))]
    public sealed class TickRoleCommand : ICommand, IUsageProvider
    {
        /// <summary>
        /// 描述项
        /// </summary>
        public string Description { get; set; } = "投票竞选命令";

        /// <summary>
        /// 命令
        /// </summary>
        public string Command => ".TickRole";

        /// <summary>
        /// 
        /// </summary>
        public bool SanitizeResponse => true;

        /// <summary>
        /// 
        /// </summary>
        public string[] Aliases { get; } = { ".TickR" };

        /// <summary>
        /// 
        /// </summary>
        public string[] Usage { get; } = { "身份编号" };

        /// <summary>
        /// 
        /// </summary>
        /// <param name="arguments"></param>
        /// <param name="sender"></param>
        /// <param name="response"></param>
        /// <returns></returns>
        public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
        {
            bool isPlayer = sender is PlayerCommandSender;

            if (!isPlayer)
            {
                response = "你必须以一名玩家身份发送该命令！";
                return false;
            }

            if (arguments.Count != 1)
            {
                response = "这似乎是不正确的格式";
                return false;
            }

            response = "投票成功";
            return true;
        }
    }
}
